﻿/*
 * Twipler - Twitter Web Client with features.
 *  
 *  Copyright (C) 2009, 2010. Ian Quigley
 * 
 *  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details. 
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>. 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Twipler.App.Parse;
using Twipler.App.Parse.Html;
using Twipler.Data.Access;
using Twipler.Data.Entity.Theme;

namespace Twipler.App.Render.Tree
{
    /* Obsolute 
    public class IncludeItem : AbstractItem
    {
        private String _code;

        private AbstractItem _root;

        private AbstractItem Root
        {
            get
            {
                if (_root != null)
                    return _root;

                Block block = Factory.Block.GetByCode(_code).FirstOrDefault();
                if (block == null)
                    _root = ParseErrorItem.Create(string.Format("Could not find block {0}.", _code), 0);

                _root = (new Template(block.Content)).Parse();

                return _root;
            }
        }

        public override List<AbstractItem> Children { get { return new List<AbstractItem> { Root }; } }

        public static IncludeItem Create(string code)
        {
            return new IncludeItem() { _code = code };
        }

        public override void Render(System.Text.StringBuilder html, App.Machine.Environment environment)
        {
            if (Root != null)
                Root.Render(html, environment);
        }
    }
    */
}